<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../inc/taglibs.jsp" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <meta name="description" content="Violate Responsive Admin Template">
    <meta name="keywords" content="Super Admin, Admin, Template, Bootstrap">
    <title>Super Admin Responsive Template</title>
    <!-- CSS -->
    <%@ include file="../inc/new/css.jsp" %>
</head>
<body id="skin-cloth">
<%@ include file="../inc/new/header.jsp" %>
<div class="clearfix"></div>
<section id="main" class="p-relative" role="main">
    <%@ include file="../inc/new/menu.jsp" %>
    <section id="content" class="container">
        <input type="hidden" id="postId" value="${postId}"/>
        <div class="block-area" id="tableHover">
            <table class="table table-bordered table-hover tile" id="dataTables" cellspacing="0" width="100%">
                <thead>
                <tr>
                    <th>账号</th>
                    <th>昵称</th>
                    <th>投票时间</th>
                    <th>性别</th>
                    <th>选项</th>
                </tr>
                </thead>
            </table>
        </div>
    </section>
    <br/><br/>
</section>
<!-- JS -->
<%@ include file="../inc/new/foot.jsp" %>

<script>
    post = {
        v: {
            list: [],
            dTable: null
        },
        fn: {
            init: function () {
                post.v.dTable = $leoman.dataTable($('#dataTables'), {
                    "processing": true,
                    "serverSide": true,
                    "searching": false,
                    "ajax": {
                        "url": "${contextPath}/admin/post/infoData/list",
                        "type": "POST"
                    },
                    "columns": [
                        {"data": "userInfo.mobile"},
                        {"data": "userInfo.nickname"},
                        {
                            "data": "createTime",
                            render: function (data) {
                                if (data == null) {
                                    return "暂无";
                                } else {
                                    return new Date(data).format("yyyy-MM-dd hh:mm:ss");
                                }
                            }
                        },
                        {
                            "data": "userInfo.gender",
                            render: function (data) {
                                if (data == 0) {
                                    return "男";
                                } else {
                                    return "女";
                                }
                            }
                        },
                        {"data": "tpSubNames"}
                    ],
                    "fnServerParams": function (aoData) {
                        aoData.postId = $("#postId").val();
                    }
                });
            }
        }
    };

    $(function () {
        post.fn.init();
    });
</script>
</body>
</html>

